#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

#define MYPORT 3334

int main()
{
	int sockfd;
	struct sockaddr_in my_addr;
	if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
	{
		perror("Server-socket() error lol!");
		exit(1);
	}
	else
		printf("Server-socket() sockfd is OK\n");
	my_addr.sin_family = AF_INET;
	my_addr.sin_port = htons(MYPORT);
	my_addr.sin_addr.s_addr = INADDR_ANY;
	memset(&my_addr.sin_zero, 0, 8);

	if (bind(sockfd, (struct sockaddr*)&my_addr, sizeof(struct sockaddr)) < 0)
	{
		perror("Server-bind() error lol!");
		exit(1);
	}
	else
		printf("Server-bind() sockfd is OK\n");
	sleep(100);

	return 0;
}
